package com.reading.vo;

import lombok.Data;
import lombok.ToString;
/**
 *
 * @author Jerry.xu
 * @date 2024/11/20
 */
@Data
@ToString
public class Rmed {
    /**
     * 1:成功
     * 0：失败
     */
    Integer code;

    /**
     * SUCCESS
     * ERROR
     */
    String message;

    /**
     * 数据
     */
    Object data;


    /**
     * static :静态方法，类名.方法名   ResultCommon.suceess
     * 非静态方法：new 类    ResultCommon rc =  new ResultCommon  rc.suceess
     * @param-data
     * @return
     */
    public static Rmed suceess(){
        Rmed remd = new Rmed();
        remd.setCode(1);
        remd.setMessage("SUCCESS");
        return remd;
    }
    public static Rmed suceessData(Object data){
        Rmed rmed = new Rmed();
        rmed.setCode(1);
        rmed.setMessage("SUCCESS");
        rmed.setData(data);
        return rmed;
    }
    public static Rmed error(String message){
        Rmed remd = new Rmed();
        remd.setCode(0);
        remd.setMessage(message);
        return remd;
    }
}
